package com.qtx.report.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qtx.report.entity.SysMenu;
import com.qtx.report.mapper.SysMenuMapper;
import com.qtx.report.pojo.dto.SysMenuDto;
import com.qtx.report.service.ISysMenuService;
import com.qtx.report.utils.NumUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 菜单信息表 服务实现类
 * </p>
 *
 * @author qtx
 * @since 2022-09-21
 */
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> implements ISysMenuService {

    @Override
    public boolean saveOrUpdateNew(SysMenuDto dto) {
        SysMenu menu = new SysMenu();
        BeanUtils.copyProperties(dto, menu);
        menu.setMenuId(NumUtils.uuid());
        return saveOrUpdate(menu);
    }
}
